package com.jiangnan.service;

import com.jiangnan.utils.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *登入服务
 * @author chenliang
 * @email wschenliang@aliyun.com
 */
public class LoginService {
    private final static Logger logger= LoggerFactory.getLogger(LoginService.class);

    private static LoginService loginService;
    private LoginService() {
    }

    public static LoginService newInstance() {
        if (loginService == null) {
            loginService = new LoginService();
        }
        return loginService;
    }


    public boolean checkUser(String userName, String password) {
        if (StringUtils.hasBlank(userName, password)) {
            logger.debug("请填写正确的用户名和密码");
        }
        if (userName.equals("admin") && password.equals("admin")) {
            return true;
        }
        return false;
    }
}
